import request from '@/utils/request'

// 查询对账单列表
export function listCheckOrder(query) {
  return request({
    url: '/finance/checkOrder/list',
    method: 'post',
    data: query
  })
}

// 查询对账单详细
export function getCheckOrder(id) {
  return request({
    url: '/finance/checkOrder/' + id,
    method: 'get'
  })
}

// 新增对账单
export function addCheckOrder(data) {
  return request({
    url: '/finance/checkOrder/add',
    method: 'post',
    data: data
  })
}

// 修改对账单
export function updateCheckOrder(data) {
  return request({
    url: '/finance/checkOrder/update',
    method: 'post',
    data: data
  })
}

// 删除对账单
export function delCheckOrder(id) {
  return request({
    url: '/finance/checkOrder/delete/' + id,
    method: 'post'
  })
}

export function initFinanceCheckOrderDto(ids){
  return request({
    url: '/finance/checkOrder/generateCheckOrderItemsByFinanceOrderIds',
    method: 'post',
    data: ids
  })
}

export function auditCheckOrder(id){
  return request({
    url: '/finance/checkOrder/audit/'+ id,
    method: 'post',
  })
}

export function auditCancelCheckOrder(id){
  return request({
    url: '/finance/checkOrder/auditCancel/'+ id,
    method: 'post',
  })
}

export function closeCheckOrder(id){
  return request({
    url: '/finance/checkOrder/close/'+id,
    method: 'post',
  })
}